var app = new Vue({
    el: '#positionlist',
    data() {
        return {
            msg: 'positionlist',
            //产品总条数
            total: '100',
            //每页数据条数
            pageSize: '5',
            pageNo: 1,
            index: 3,
            bannerImage: ''
        }
    },
    created() {
        this.getPositionList()
    },
    methods: {
        getPositionList() {
            this.getHeaderList();
            // axios.post('product/service/normalProduct/findByPage?pageNo=' + this.pageNo + '&pageSize=' + this.pageSize, this.params)
            //     .then(res => {
            //         console.log(res)
            //     })
            //     .catch(err => {
            //         console.error(err);
            //     })
        },
        getHeaderList() {
            var storage = window.sessionStorage;

            var c = storage.getItem("headerList");

            if (!c) {
                axios.get('system/service/viewMenu/findAll')
                    .then(res => {
                        this.headerList1 = res.data.data;
                        this.bannerImage = this.headerList1[this.index].bgImg
                        storage.setItem("headerList", JSON.stringify(this.headerList1));
                    })
                    .catch(err => {
                        console.error(err);
                    })
            } else {
                this.headerList1 = JSON.parse(c);
                this.bannerImage = this.headerList1[this.index].bgImg
            }
        }
    }
})